package com.hehe.controller;

import com.hehe.POJO.Article;
import com.hehe.Repository.ArticleRepository;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import java.util.Optional;

@Slf4j
@Controller
@RequestMapping(value = "")
public class ArticleHtmlController {

    @Value("${config_file_name}")
    private String config_file_name;

    @Resource
    private ArticleRepository articleRepository;


    @GetMapping(value = "/article-html/{html_file}")
    public String index(Model model, @PathVariable String html_file) {
//        System.out.println(html_file);
//        System.out.println(html_file);
        return "article-html/" + html_file;
    }


//    @GetMapping(value="/article/{id}"  )
//    public String article_detail(Model model){
//        log.info("article_detail.html");
//        return "article_detail.html";
//    }


}




